package presentation;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;

import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JPanel;

/*
 * Creates the Panel with the instructions written on it.
 * 
 */

public class InstructionsPanel extends JPanel {

	private ImageIcon background =
            new ImageIcon ("gamebackground1.jpg");
	
	/**
	 * Create the panel.
	 */
	public InstructionsPanel() {
		JLabel instructionLabel = new JLabel("<html> Instructions:<br/>" +
										"<br/>The game will start with two players.<br/>" +
										"<br/>The first player must reproduce the gesture displayed on the screen.<br/>" +
										"<br/>Then the second player must reproduce the first gesture followed by " +
										"<br/>the gesture displayed on the screen.<br/>" +
										"<br/>After that the first player must repeat the two first gestures followed by " +
										"<br/>the new gesture displayed on the screen. And so on.<br/><br/>" +
										"<br/>The game continues until there is no player left! </html>" );
		this.add(instructionLabel);
		this.setOpaque(true);
		this.setBackground(new Color(0,0,0,0));

	}
	
	//Set background and size
	@Override
    public void paintComponent(Graphics g) {
        super.paintComponent(g);
        g.drawImage(background.getImage(), 0, 0, null);
    }

    @Override
    public Dimension getPreferredSize() {
        return new Dimension(
        	background.getImage().getWidth(null),
        	background.getImage().getHeight(null));
    }


}
